<div class="content1">
    <div class="left_ct1">
		
        <div class="img_main">
			<a href="<?=url_create('site','ViewPage','index',$main_page->id,$main_page->title)?>">
				<img src="<?=image_url($main_page->image)?>" width="356" height="234"/>
			</a>
		</div>
        <div class="tit_main">
			<a href="<?=url_create('site','ViewPage','index',$main_page->id,$main_page->title)?>"><?=$main_page->title?></a>
		</div>
        <div class="ct_news"><?=$main_page->summary?></div>
    </div>

    <div class="mid_ct1">
        <div class="datetime" id="clock">
		</div>

        <script type="text/javascript">
            function refrClock(){
				var d=new Date();
				var s=d.getSeconds();
				var m=d.getMinutes();
				var h=d.getHours();
				var day=d.getDay();
				var date=d.getDate();
				var month=d.getMonth();
				var year=d.getFullYear();
				var days=new Array("Chủ nhật","Thứ hai","Thứ 3","Thứ 4","Thứ 5","Thứ 6","Thứ 7");
				var months=new Array("1","2","3","4","5","6","7","8","9","10","11","12");
				var am_pm;
				if (s<10) {s="0" + s}
				if (m<10) {m="0" + m}
				if (h>12) {h-=12;AM_PM = "PM"}
				else {AM_PM="AM"}
				if (h<10) {h="0" + h}
				document.getElementById("clock").innerHTML=days[day] + " Ngày " + date + "/" +months[month] + "/" + year + " - "+ "  [" + h + ":" + m + ":" + s + "] " + AM_PM;
				setTimeout("refrClock()",1000);
            }
            refrClock();
        </script>

        <div class="top_news"><?=$main_cat->info[$lang]->name?></div>
        <div class="ds_news">
            <ul>
				<?foreach($main_cat->pages as $page){?>
				<li>
					<a href="<?=url_create('site','ViewPage','index',$page->id,$page->title)?>"><?=$page->title?></a>
				</li>
				<?}?>
			</ul>
        </div>
    </div>

    <div class="right_ct1">
		<? if (isset($banner_left)) { ?>
			<? foreach ($banner_left as $banner) { ?>
				<div class="qc1">
					<a title="" href="<?= $banner->link ?>"<?= $banner->target ?>><img width="300px" border="0" alt="" src="<?= image_url($banner->image) ?>"></a>
				</div>
			<? } ?>
		<? } ?>
		<?if($youtube!=''){?>
		<div>
			<iframe width="298" height="220" frameborder="0" allowfullscreen="" src="<?php echo youtube_embed($youtube) ?>"></iframe>
		</div>
		<?}?>
	</div>
</div>
<div class="content2">
	<div class="left_ct2">
		<?
		foreach ($homecats as $cat) {
			if (count($cat->pages) == 0)
				continue;
			?>
			<div class="muctin">
				<div class="top_tin"><?= $cat->name ?></div>
				<div class="bgtin">
					<div class="tittin">
						<a href="<?= url_create('site', 'ViewPage', 'index', $cat->pages[0]->id, $cat->pages[0]->title) ?>" title="<?= $cat->pages[0]->title ?>"><?= $cat->pages[0]->title ?></a>
					</div>
					<div class="ndtin">
						<a href="<?= url_create('site', 'ViewPage', 'index', $cat->pages[0]->id, $cat->pages[0]->title) ?>" title="<?= $cat->pages[0]->title ?>">
							<img width="117" height="73" style="float:left; margin-right:10px" src="<?= image_url($cat->pages[0]->thumb) ?>" alt="<?= $cat->pages[0]->title ?>">
						</a>
						<?= striplongstr($cat->pages[0]->summary,300) ?>
					</div>
					<div class="line_tin">
					</div>
					<div class="tinkhac">
						<ul>
							<? for ($i = 1; $i < count($cat->pages); $i++) { ?>
								<li>
									<a href="<?= url_create('site', 'ViewPage', 'index', $cat->pages[$i]->id, $cat->pages[$i]->title) ?>"><?= striplongstr($cat->pages[$i]->title, 65) ?></a>
								</li>
							<? } ?>
						</ul>
					</div>
				</div>
				<div class="bottom_tin">
					<a href="<?= url_create('site', 'ViewCatalogue', 'index', $cat->id, $cat->name) ?>">
						<span>Xem tiếp</span>
					</a>
				</div>
			</div>
		<? } ?>
	</div>

	<div class="rightct2">
		<div class="tinmoi">
			<div class="top_tm">Tin mới nhất</div>
			<div class="bg_tm">
				<? foreach ($news as $page) { ?>
					<div class="news">
						<a href="<?= url_create('site', 'ViewPage', 'index', $page->id, $page->title) ?>"><img width="78" height="63" style="float:left" src="<?= image_url($page->thumb) ?>"></a> 
					<a href="<?= url_create('site', 'ViewPage', 'index', $page->id, $page->title) ?>"><?= $page->title ?></a>
					</div>
				<? } ?>
			</div>
		</div>
		<br/>
		<div style="margin-left: 4px">
			<div class="fb-like-box" data-href="<?= $social_page ?>" data-width="294" data-show-faces="true" data-stream="false" data-header="false"></div>
			<br/>
			<br/>
			<!-- Histats.com  START  (standard)-->
			<script type="text/javascript">document.write(unescape("%3Cscript src=%27http://s10.histats.com/js15.js%27 type=%27text/javascript%27%3E%3C/script%3E"));</script>
			<a href="http://www.histats.com" target="_blank" title="web log free" ><script  type="text/javascript" >
				try {Histats.start(1,2272502,4,2035,130,60,"00011000");
					Histats.track_hits();} catch(err){};
				</script></a>
			<noscript><a href="http://www.histats.com" target="_blank"><img  src="http://sstatic1.histats.com/0.gif?2272502&101" alt="web log free" border="0"></a></noscript>

		</div>
		<div class="ad">
		</div>
	</div>
</div>